.box{
    display: flex;
    margin: 50px auto;
    border-radius: 8px;
    width: 1200px;
    background: #f3f3f4;
    flex-direction: column;
    /* 移除固定高度，改为自适应内容高度 */
}

.head{
    border-radius: 8px 8px 0 0;
    display: flex;
    width: 100%;
    height: 80px;
    background: white;
    margin-top: 0;
    margin-bottom: 20px;
}

.mid{
    display: flex;
    width: 100%;
    height: 40px;
    background: white;
    margin-bottom: 20px;
}

.box1{
    display: flex;
    width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 0 0 8px 8px;
    padding: 20px; /* 添加内边距防止内容贴边 */
    box-sizing: border-box; /* 确保内边距不影响总宽度 */
}

.logo{
    margin: 20px 30px;
    background-repeat: no-repeat;
    display: block;
    width: 80px;
    height: 80px;
    background-image: url("../images/j8.png");
    font-size: 0;
    background-size: contain;
}

.text1 h3{
    font-weight: 400;
    margin-top: 25px;
    color: #5725bc;
}

.search {
    margin: 25px auto;
    display: flex;
    margin-left: 64px;
    padding-left: 10px;
    width: 700px;
    height: 35px;
    background-color: #f3f5f7;
    border-radius: 20px;
}

.search input {
    flex: 1;
    border: 0;
    background-color: transparent;
    outline: none;
}

.img1{
    margin-top: 5px;
    width: 25px;
    height: 25px;
}

.search a {
    padding-left: 10px;
    display: flex;
    color: white;
    flex-wrap: nowrap;
    width: 60px;
    height: 35px;
    background: #5725bc;
    border-radius: 0 20px 20px 0;
    line-height: 35px;
}

.user img{
    display: flex;
    margin-right: 20px;
    margin-top: 15px;
}

.name{
    display: flex;
    margin-right: 20px;
    margin-bottom: 30px;
    padding-bottom: 10px;
}

.mid ul{
    display: flex;
    margin: 0 auto;
}

.mid li{
    margin:0 40px ;
    line-height: 40px;
}

.box1 {
    flex-direction: column;
    display: flex;
    background: white;
    border-radius: 0 0 8px 8px;
    padding-top: 0;
}

.banner img {
    margin: 0 auto;
    display: flex;
    width: 100%; /* 改为100%宽度适应容器 */
    max-width: 800px; /* 保留最大宽度 */
    height: auto; /* 高度自动适应 */
    align-self: flex-start;
}

.recommend{
    display: flex;
    width: 100%;
    height: 40px;
    background: white;
}

.recommend ul {
    display: flex;
    margin: 0;
    padding: 0;
}

.recommend li {
    margin-top: 10px;
    margin-right: 40px;
}

.course{
    display: flex;
    flex-wrap: wrap; /* 允许换行 */
    gap: 15px; /* 卡片间距 */
    padding: 0;
    margin: 0;
    list-style: none;
    width: 100%;
}

.course li {
    display: flex;
    flex-direction: column;
    margin: 0; /* 移除原有margin，使用gap控制间距 */
    width: calc(25% - 11px); /* 4列布局，减去间距 */
    background-color: #f3f3f4;
    border-radius: 2px;
    box-sizing: border-box;
}

.s1 img{
    border-radius: 2px 2px 0 0;
    width: 100%; /* 图片适应卡片宽度 */
    height: 100px;
    object-fit: cover; /* 保持图片比例 */
}

.text1 h5{
    font-weight: 400;
    font-size: 14px;
    padding: 0 10px;
}

.text1 p{
    color: darkgray;
    padding: 0 10px;
    margin: 5px 0;
}

.text1 span{
    float: right;
    color: #FF0C0CEF;
    padding: 0 10px 10px;
}

.text1 h4{
    font-weight: 500;
    font-size: 16px;
}

.image-overlay {
    position: absolute;
    bottom: 5px;
    right: 65px;
    width: 200px;
    height: 200px;
    z-index: 5;
    background-image: url(../images/cube.png);
    background-size: contain;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .box {
        width: 95%;
    }
}

@media (max-width: 1024px) {
    .box1 {
        width: 90%;
    }
    .course li {
        width: calc(33.333% - 10px); /* 3列布局 */
    }
}

@media (max-width: 768px) {
    .course li {
        width: calc(50% - 7.5px); /* 2列布局 */
    }
    .search {
        width: 50%;
    }
}

@media (max-width: 480px) {
    .course li {
        width: 100%; /* 1列布局 */
    }
    .mid li {
        margin: 0 15px;
    }
    .search {
        width: 40%;
        margin-left: 20px;
    }
}